const mutations = {
  setLoginInfo(state: any, data: any) {
    state.account = data.account
    state.token = data.token
    state.profile = data.profile
    localStorage.setItem('account', JSON.stringify(data.account))
    localStorage.setItem('token', data.token)
    localStorage.setItem('profile', JSON.stringify(data.profile))
  },
  setPlaylist(state: any, data: Array<any>) {
    state.playlist = data
    localStorage.setItem('playlist', JSON.stringify(data))
  },
  setCurrentPlaying(state: any, data: any) {
    state.currentPlaying = data
    localStorage.setItem('currentPlaying', JSON.stringify(data))
  },
  setPlayOrPause(state: any, data: string) {
    state.playOrPause = data
    localStorage.setItem('playOrPause', data)
  },
  setPlayIndex(state: any, data: number) {
    state.playIndex = data
    localStorage.setItem('playIndex', data.toString())
  },
  setAudioProgress(state: any, data: number) {
    state.audioProgress = data
    localStorage.setItem('audioProgress', data.toString())
  },
  setAudioObj(state: any, data: any) {
    state.audioObj = data
  },
  setCurrentVideoPlaying(state: any, data: string) {
    state.currentVideoPlaying = data
  },
  setIsFirstRun(state: any, data: boolean) {
    state.isFirstRun = data
  },
}

export default mutations
